package main

import (
	"fmt"
)

type AccessTokenVO struct {
	AppAccessToken    string `json:"app_access_token"`
	Code              int32  `json:"code"`
	Expire            int32  `json:"cxpire"`
	Msg               string `json:"msg"`
	TenantAccessToken string `json:"tenant_access_token"`
}

func main() {
	url := "https://open.feishu.cn/open-apis/auth/v3/app_access_token/internal"
	fmt.Println("URL:>", url)

	var jsonStr = []byte(`{"app_id":"` + url + `", "app_secret":"fVorBy002f3ZG1N87PqY2dw7BaFlgp7p"}`)
	print(string(jsonStr))
	//req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonStr))
	//req.Header.Set("Content-Type", "application/json")
	//client := &http.Client{}
	//resp, err := client.Do(req)
	//if err != nil {
	//	panic(err)
	//}
	//defer resp.Body.Close()
	//
	//fmt.Println("response Status:", resp.Status)
	//fmt.Println("response Headers:", resp.Header)
	//body, _ := ioutil.ReadAll(resp.Body)
	//fmt.Println("response Body:", string(body))
	//
	//var accessToken AccessTokenVO
	//if err := json.Unmarshal(body, &accessToken); err != nil{
	//	fmt.Println(err)
	//}
	//fmt.Println(accessToken.Code)
	//fmt.Println(accessToken.AppAccessToken)

}
